package com.bookstore.utils;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117658710";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCNe758RSKt+2CiFPvEb7yAgkRk4fiISwE7Syb/+ccaLH1whAmwYMnUV2+UVDplbPtCtuf1SSZP+X/KXfRFWEkJeLOX7gY3b48pzC1JkzLnGvi8V+WlE8IJibgTlJn8KcW4By1/YdpnrdwLz4JXXZXOAZXGsYcFfw4PwS/7LenaaNn/NhMYpIhJfEhHuFKzgHsZ0RawGEdkyesvUQzSNBKuX4Ytayw9BKs/UJ4WbN06L9Z6KxuCT/q5WZIiOA00gopgBxqHkIsXSNiqmTjneia/Jg1b4TI/8TqXAYzzjgVAtx0uy3gMk/ynDsz/Yf0YF69AxGfzP9uhlvS05PXsx4mJAgMBAAECggEABpskhcDkoaL/HBJGvyFId+edMeirJhH6eL5Fj+Ylub8iDELeAPJD+joq544XO+0evjq0EevccheAM/63DRXWMy8Dk7B1cdkvog/6fVj2I3xK6OBhxJdrk+5uPdvOZMu+g50yLqRvAjBH+fUybMnd2MSSLbjUSRlpmqq2hs/Z/2ycByusivdFkjbdFI572Hh0AqPDeRVc/CiO0K9R7A//p1+uwVFVyEAg2YNTp/wizlbsnTHh9ayP+obN09U0dkhI/7VkJidU3Nj6Nb6qEMO+BC8pAb6vzn8NiAqsH0TJ3W9CZt9zW3kRrP+9rS84P/t8fhgGJ4bbcKQsn/F54YVuQQKBgQDRI0LY1IdvJNDwqAncQkE+n1wxujaZqdREAAC7qeQthUHsTQhrIwTFr5rTGpNNwDevTK/WlIHOAeI2Xxnl1LR/aEnuki5i5JGh4y49b080XsTpQgKC5REl7wr4lZoyqyNPZrR77hnD5dHqwOArRHdwdi7K4brS7yCncyG2Cv0UdQKBgQCtL6Kaa/OOz/gIsnU0mw1VpvuT6Bdh+WiFSDuvk+fYfyx7Vyzz1ZK2PV+xRihNWFxMUBNES/aHJVSGtdAoa8oWWJWyL/0tiZF6e7dL1LZCXJmYevD13XsEVZ/k2lzODEfap3mEaGW2aBrcelUxRBZVaiosVQhMq80z0Hp63NQuRQKBgGCsIfxE0Y3owMRdiKFN5wbhdyZtY0vImxwLvEsDDzyTepOWUCvl9hDDSZgHksu/7H2Vvzo7T31AlaZ4c2ov1neGZ5Zl8Bc6fK8OapNvXndgzzjbkHmdFT4przKVRL/jJ+FOImOe/j31gAE5wuV9MpDDsIGLsmZKrxd4Or8BeVb5AoGBAJuxOEgFBmd8FWqULIQHZFx9Cqw0OVkt48X2Yxn8KLDb23xiqZnnhcZptG5lOPQXnJpKXpfGhrGGYM/eAW1lQb8HEkSnmb7nbq6jK+xzJQrRvo9y7s7Jtr71zxHpMQdXyP0MFFVxmQb73jIZlB7/K+jL0XAbXaO3y3lqUcHEZsfVAoGBAKF1RM3XtxY+6j4iBs2KqIPti8kiNmUxQRyxjRpOzRC6uAtjKWWqNIIxR3zg1br9dsdEvql8skaVnMlGa2G/2ffs6lLQAAPIfsKmn89AVcRoykQ/fxTTdaI9KuCbA+Gp66R4FIAk2RLX53x9uj54/i25kfcTnQlOhsRQUwMO9LaU";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjHqIQbbU7zoKoLvnJQbAVdyi8EDang2rDslDt1HpVDxmDsAH0EUdOhBg3s4y+tnjTIi5mcU+AU+n5edT2vDfhrFZFrE/H0xMlcCSwJnMjt4DpWhKedb8xbYpCO1aLrQ+4X/2oH4Nq+sSEbn2YtcZmfcdIDwsWabhf3IsC1nEvD6DZ95e+98A18+ohCNyU1O4h87wCrj2+Ykw2pbMcfhXmINs7EyBdKxE2D1wax/0bP6LCV6AkU8K8C5mBxXopUWJhELDW+u0Lbo8/SMDaa/zBHlDkxRMUZlZXc+qvsyea81M3UJZge7AYDdyChQRq2Wva8rawlaHXm34+YS4pn21pQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/bookstore/client/order/paysuccess";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
